/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class MedicoDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression cod_medico;
	public final StringExpression nombre_med;
	public final StringExpression apellido_med;
	public final StringExpression especialidad;
	
	public MedicoDetachedCriteria() {
		super(Medico.class, MedicoCriteria.class);
		cod_medico = new IntegerExpression("cod_medico", this.getDetachedCriteria());
		nombre_med = new StringExpression("nombre_med", this.getDetachedCriteria());
		apellido_med = new StringExpression("apellido_med", this.getDetachedCriteria());
		especialidad = new StringExpression("especialidad", this.getDetachedCriteria());
	}
	
	public MedicoDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, MedicoCriteria.class);
		cod_medico = new IntegerExpression("cod_medico", this.getDetachedCriteria());
		nombre_med = new StringExpression("nombre_med", this.getDetachedCriteria());
		apellido_med = new StringExpression("apellido_med", this.getDetachedCriteria());
		especialidad = new StringExpression("especialidad", this.getDetachedCriteria());
	}
	
	public CuestionarioDetachedCriteria createCuestionarioCriteria() {
		return new CuestionarioDetachedCriteria(createCriteria("ORM_Cuestionario"));
	}
	
	public Medico uniqueMedico(PersistentSession session) {
		return (Medico) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Medico[] listMedico(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Medico[]) list.toArray(new Medico[list.size()]);
	}
}

